package com.yusys.jin.blog.util;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class VerifiedCode {

    private static char[] letters = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
            'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
            'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
            '6', '7', '8', '9'};
    private static Map<Integer, Color> colors = new HashMap<Integer, Color>();

    static {
        colors.put(0, Color.BLACK);
        colors.put(1, Color.BLUE);
        colors.put(2, Color.CYAN);
        colors.put(3, Color.GRAY);
        colors.put(4, Color.GREEN);
        colors.put(5, Color.ORANGE);
        colors.put(6, Color.PINK);
        colors.put(7, Color.RED);
        colors.put(8, Color.YELLOW);
        colors.put(9, Color.MAGENTA);
        colors.put(10, Color.LIGHT_GRAY);
    }

    public static char[] getLetters() {
        return letters;
    }

    public static char getLetter() {
        Random rand = new Random();
        return letters[rand.nextInt(letters.length)];
    }

    public static Map<Integer, Color> getColors() {
        return colors;
    }
}
